/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package main.entities;

import java.util.ArrayList;
import main.entities.actors.AbstractActor;
import main.environment.IEnvironment;

/**
 *
 * @author williamh
 */
public class EntityHandler {
    
    private ArrayList<AbstractActor> entities;
    
    public EntityHandler() {
        entities = new ArrayList<AbstractActor>();
    }
    
    public AbstractActor getEntity(int i){
        return entities.get(i);
    }
    
    public void addEntity(AbstractActor s){
        entities.add(s);
    }
    
    public void removeEntity(AbstractActor s){
        entities.remove(s);
    }
    
    public void run(IEnvironment e){
        for (AbstractActor a : entities){
            a.run(e);
        }
    }
}